package auction.chapter16.factory;

import auction.chapter16.dao.BidDAO;
import auction.chapter16.dao.ItemDAO;
import auction.chapter16.dao.UserDAO;
import auction.chapter16.factory.impl.HibernateDAOFactory;

public abstract class DAOFactory {
	
	public static Class HIBERNATE=HibernateDAOFactory.class;
	
	public static DAOFactory instance(Class factory){
		try{
			return (DAOFactory)factory.newInstance();
		}catch(Exception ex){
			throw new RuntimeException("Couldn't create DAOFactory: "+factory);
		}
	}
	
	public abstract ItemDAO getItemDAO();
	public abstract BidDAO getBidDAO();
	public abstract UserDAO getUserDAO();
}
